
package com.eshop.we.business.impl;

import com.alibaba.dubbo.config.annotation.Reference;
import com.baomidou.mybatisplus.plugins.Page;
import com.eshop.we.book.api.BookService;
import com.eshop.we.book.dto.BookDto;
import com.eshop.we.book.entity.Book;
import com.eshop.we.book.enums.StatusEnum;
import com.eshop.we.business.BaseBusinessImpl;
import com.eshop.we.business.BookBusiness;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wangzhanguo
 * @create 2018-06-04 15:31
 **/
@Service
public class BookBusinessImpl extends BaseBusinessImpl<Book,BookService> implements BookBusiness{
    @Reference
    private BookService bookService;

    @Override
    public Page selectBookPage(Page<BookDto> page, String name, String bookName, String startDate, String endDate) {
        return bookService.selectBookPage(page,  name,  bookName,  startDate,  endDate);
    }

    @Override
    public List<Book> searchBook(Book book) {
        book.setStatus(StatusEnum.STATUS_DOWN.getCode());
        return bookService.searchBook(book);
    }
}

